﻿using Microsoft.AspNetCore.Http;

namespace WH.Common.Web
{
    public class HttpContext
    {
        /// <summary>
        /// 
        /// </summary>
        private static IHttpContextAccessor? _contextAccessor;

        /// <summary>
        /// 当前上下文
        /// </summary>
        public static Microsoft.AspNetCore.Http.HttpContext? Current => _contextAccessor?.HttpContext;

        public static void Configure(IHttpContextAccessor contextAccessor)
        {
            _contextAccessor = contextAccessor;
        }
    }

}